#pragma once

#include "ShaderProgram.h"
#include "Mesh.h"
#include <assimp/mesh.h>
#include <assimp/scene.h>
#include <string>

class Model {
public:
    Model(const std::string &path);
    ~Model();

public:
    void draw(ShaderProgram &program);

private:
    void                       loadModel(const std::string &path);
    void                       processNode(aiNode *node, const aiScene *scene);
    Mesh                      *processMesh(aiMesh *mesh, const aiScene *scene);
    std::vector<OpenGLTexture> loadMaterialTextures(aiMaterial *mat, aiTextureType type, std::string typeName);

private:
    std::vector<Mesh *>        m_meshes;
    std::string                m_directory;
    std::vector<OpenGLTexture> m_texturesLoaded;
};